package com.yn.pet.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum AlarmSwitchEnum {
    NO(0, "否"),
    YES(1, "是");
    private Integer code;
    private String name;

    public static AlarmSwitchEnum getByCode(Integer code) {
        if (code == null) {
            return null;
        }
        for (AlarmSwitchEnum enumObj : AlarmSwitchEnum.values()) {
            if (enumObj.getCode().equals(code)) {
                return enumObj;
            }
        }
        return null;
    }

}



